<div class="admin list goods">

	<a class="btn add" href="<?php $params = array(); if($categoryId > 0) {$params['categoryId'] = $categoryId;} echo $this->createUrl('/admin/goods/editor/', $params); ?>">Добавить товар</a>

    <table>
        <tr>
            <th>Назва</th>
            <th></th>
        </tr>

        <?php if($oRowset): ?>
            <?php $index = 0; foreach($oRowset as $oRow): $index++; ?>
            <tr class="row<?php echo $index % 2 == 1 ? ' grey' : ''; ?>">
                <td>
                    <a href="<?php echo $this->createUrl('/goods/default/view/', array('id' => $oRow->createUrlId())); ?>" target="_blank"><?php echo $oRow->title; ?></a>
                </td>
                <td class="action">
                    <a href="<?php echo $this->createUrl('/admin/goods/editor/', array('id' => $oRow->id)); ?>">Редактировать</a>
                    <a onclick="return confirm('Удалить товар?');" href="<?php echo $this->createUrl('/admin/goods/delete/', array('id' => $oRow->id)); ?>">Удалить</a>
                </td>
            </tr>
            <?php endforeach; ?>

        <?php endif; ?>
    </table>

    <?php
    $this->widget('CLinkPager', array(
        'pages' => $this->oPager,
        'maxButtonCount'=>5,
        'header'=>'',
        'htmlOptions'=>array('class'=>'pager'),
    )); ?>
</div>